/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cepicam.src.view;
import java.awt.CardLayout;

import javax.swing.JPanel;

import cepicam.src.controller.*;


/**
 *
 * @author Kalimera
 */
public class FramePrincipale extends javax.swing.JFrame {

    /**
     * Creates new form ApplicationWindow
     */
    public FramePrincipale() {
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    public void initComponents(PanelMenu pmenu, PanelConnexion pconnect,PanelTableauDeBord ptdb) {
    	
   
        panelPrincipalGauche = new PanelPrincipalGauche(pmenu, pconnect);
        panelPrincipalDroit = new PanelPrincipalDroit (); 
        jPanel1 = new javax.swing.JPanel();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuFichier = new javax.swing.JMenu();
        jMenuItemQuitter = new javax.swing.JMenuItem();
        jMenuEdition = new javax.swing.JMenu();
        jMenuAide = new javax.swing.JMenu();
        jMenuItemApropos = new javax.swing.JMenuItem();
        cl = new CardLayout();

       // ptdbe = new PanelTableauDeBord();
        //PanelEleves pe = new PanelEleves(new CtrlEleve());
        
        
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setPreferredSize(new java.awt.Dimension(1024, 768));


        panelPrincipalDroit.setLayout(cl);
     //   panelPrincipalDroit.add(ptdbe, "ptdbe");
        //panelPrincipalDroit.add(pe,"pe");
        //cl.show(panelPrincipalDroit,"pe");
       // cl.show(panelPrincipalDroit, "ptdbe");
       
        
        jPanel1.setPreferredSize(new java.awt.Dimension(854, 150));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 854, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 150, Short.MAX_VALUE)
        );


        jMenuFichier.setMnemonic('f');
        jMenuFichier.setText("Fichier");

        jMenuItemQuitter.setMnemonic('x');
        jMenuItemQuitter.setText("Quitter");
        jMenuItemQuitter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemQuitterActionPerformed(evt);
            }
        });
        jMenuFichier.add(jMenuItemQuitter);

        jMenuBar.add(jMenuFichier);

        jMenuEdition.setMnemonic('e');
        jMenuEdition.setText("Edition");
        jMenuBar.add(jMenuEdition);

        jMenuAide.setMnemonic('h');
        jMenuAide.setText("Help");

        jMenuItemApropos.setText("A propos");
        jMenuAide.add(jMenuItemApropos);

        jMenuBar.add(jMenuAide);

        setJMenuBar(jMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(panelPrincipalGauche, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelPrincipalDroit, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(panelPrincipalGauche, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(panelPrincipalDroit, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>


    private void jMenuItemQuitterActionPerformed(java.awt.event.ActionEvent evt) {                                             
        System.exit(0);
    }    
    
    public void changeVue (JPanel panel, String name){ 	
    	cl.show(panelPrincipalDroit,name);
    }
   
    public PanelPrincipalDroit getPanelPrincipalDroit(){
    	return panelPrincipalDroit;
    }
    
    public void showInitialView(){
    	cl.show(panelPrincipalDroit, "Accueil");
    }


    // Variables declaration - do not modify
    private javax.swing.JMenu jMenuAide;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JMenu jMenuEdition;
    private javax.swing.JMenu jMenuFichier;
    private javax.swing.JMenuItem jMenuItemApropos;
    private javax.swing.JMenuItem jMenuItemQuitter;
    private javax.swing.JPanel jPanel1;
    private PanelPrincipalDroit panelPrincipalDroit;
    private PanelPrincipalGauche panelPrincipalGauche;
    private CardLayout cl;
    private PanelTableauDeBord ptdbe;
    // End of variables declaration
}
